package com.eightbears.beboy.adapter;

import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.eightbears.beboy.R;
import com.eightbears.beboy.base.util.CommonUtils;
import com.eightbears.beboy.entity.ProfitEntity;
import com.eightbears.beboy.entity.ProfitWaterEntity;

import static com.eightbears.beboy.R.id.tv_date;

/**
 * Created by Administrator on 2017/9/4.
 */

public class ProfitWarterAdapter extends BaseQuickAdapter<ProfitWaterEntity.DataBean.ListBean, BaseViewHolder> {
    public ProfitWarterAdapter() {
        super(R.layout.item_shop_account);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ProfitWaterEntity.DataBean.ListBean listBean) {
        TextView tv_money = baseViewHolder.getView(R.id.tv_money);
        tv_money.setTextColor(Color.parseColor("#ff992b"));
        baseViewHolder.setText(R.id.tv_title, listBean.getFrom().getNickname())
                .setText(R.id.tv_money, "+" + listBean.getBalance())
                .setText(tv_date, CommonUtils.TimeStamp2Date(listBean.getCreated_at(), "yyyy-MM-dd HH:mm"));
        CommonUtils.loadImageView(mContext, listBean.getFrom().getCover(),
                R.mipmap.default_icon, (ImageView) baseViewHolder.getView(R.id.iv_logo));
    }
}
